﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DynamicObjectLibrary;

namespace root
{
    interface IAlpha
    {
        int ID { get; }
        int GetTestValue();
    }

    class ImplIAlphaA : IAlpha
    {
        public int ID { get { return 0; } }
        public int GetTestValue()
        {
            return 6;
        }
    }

    class ImplIAlphaB : IAlpha
    {
        public int ID { get { return 1; } }
        public int GetTestValue()
        {
            return 3;
        }
    }

    abstract class ABeta
    {
        public abstract int ID { get; }
        public string Ancestor { get { return "My ancestor is an ABeta!"; } }
    }

    abstract class AImplABeta : ABeta
    {
        public abstract int AImplABetaID { get; }
    }

    class ImplABeta : ABeta
    {
        public override int ID
        {
            get { return 0; }
        }
    }

    class ImplAImplABeta : AImplABeta
    {
        public override int ID
        {
            get { return 1; }
        }

        public override int AImplABetaID
        {
            get { return 1; }
        }
    }

    class Program
    {
        static void Main(string[] args)
        {
            Library<int, IAlpha> alphaLib = new Library<int, IAlpha>();
            alphaLib.LoadFromAssembly(System.Reflection.Assembly.GetAssembly(typeof(IAlpha)), x => x.ID);
            Library<int, ABeta> betaLib = new Library<int, ABeta>();
            betaLib.LoadAll(x => x.ID);
        }
    }
}
